From: Georges Basile Stavracas Neto Date: Wed, 20 Jan 2021 22:25:13 +0000 (-0300) Subject: overviewControls: Make AppDisplay rise from the bottom X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~399 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=87645652e5fa65ad7d217b69c2935339f56599cf;p=gnome-shell.git overviewControls: Make AppDisplay rise from the bottom It makes more sense in a spatial overview that the app grid comes and goes to somewhere in the screen, instead of fading in and out into the void. Make the app grid rise from the bottom of the screen. Part-of: --- diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index e640564a5..efb3fd9fb 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -69,6 +69,31 @@ class ControlsManagerLayout extends Clutter.BoxLayout { return workspaceBox; } + _getAppDisplayBoxForState(state, box, searchHeight, dashHeight, appGridBox) { + const [width, height] = box.get_size(); + const appDisplayBox = new Clutter.ActorBox(); + const { spacing } = this; + + switch (state) { + case ControlsState.HIDDEN: + case ControlsState.WINDOW_PICKER: + appDisplayBox.set_origin(0, box.y2); + break; + case ControlsState.APP_GRID: + appDisplayBox.set_origin(0, + searchHeight + spacing + appGridBox.get_height()); + break; + } + + appDisplayBox.set_size(width, + height - + searchHeight - spacing - + appGridBox.get_height() - spacing - + dashHeight); + + return appDisplayBox; + } + vfunc_set_container(container) { this._container = container; this.hookup_style(container); @@ -112,7 +137,7 @@ class ControlsManagerLayout extends Clutter.BoxLayout { } // Workspaces - const params = [box, searchHeight, dashHeight, thumbnailsHeight]; + let params = [box, searchHeight, dashHeight, thumbnailsHeight]; const transitionParams = this._stateAdjustment.getStateTransitionParams(); let workspacesBox; @@ -133,14 +158,20 @@ class ControlsManagerLayout extends Clutter.BoxLayout { const workspaceAppGridBox = this._getWorkspacesBoxForState(ControlsState.APP_GRID, ...params); - childBox.set_origin(0, searchHeight + spacing + workspaceAppGridBox.get_height()); - childBox.set_size(width, - height - - searchHeight - spacing - - workspaceAppGridBox.get_height() - spacing - - dashHeight); + params = [box, searchHeight, dashHeight, workspaceAppGridBox]; + let appDisplayBox; + if (!transitionParams.transitioning) { + appDisplayBox = + this._getAppDisplayBoxForState(transitionParams.currentState, ...params); + } else { + const initialBox = + this._getAppDisplayBoxForState(transitionParams.initialState, ...params); + const finalBox = + this._getAppDisplayBoxForState(transitionParams.finalState, ...params); - this._appDisplay.allocate(childBox); + appDisplayBox = initialBox.interpolate(finalBox, transitionParams.progress); + } + this._appDisplay.allocate(appDisplayBox); // ViewSelector childBox.set_origin(0, searchHeight + spacing);